home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / devel / vbcc-ppc-src / vlink / elfcommon.h < prev    next >
C/C++ Source or Header  |  1999-01-01  |  7KB  |  178 lines

  1. /* $VER: vlink elfcommon.h V0.3b (25.04.98)
  2.  *
  3.  * This file is part of vlink, a portable linker for multiple
  4.  * object formats.
  5.  * Copyright (c) 1997-99  Frank Wille
  6.  *
  7.  * vlink is freeware and part of the portable and retargetable ANSI C
  8.  * compiler vbcc, copyright (c) 1995-99 by Volker Barthelmann.
  9.  * vlink may be freely redistributed as long as no modifications are
  10.  * made and nothing is charged for it. Non-commercial usage is allowed
  11.  * without any restrictions.
  12.  * EVERY PRODUCT OR PROGRAM DERIVED DIRECTLY FROM MY SOURCE MAY NOT BE
  13.  * SOLD COMMERCIALLY WITHOUT PERMISSION FROM THE AUTHOR.
  14.  *
  15.  *
  16.  * v0.3b (25.04.98) phx
  17.  *       Moved ELF32_R_xxx and ELF32_ST_xxx macros to elf32.h
  18.  * v0.3  (22.03.98) phx
  19.  *       File created.
  20.  */
  21.  
  22.  
  23. #ifndef ELFCOMMON_H
  24. #define ELFCOMMON_H
  25.  
  26.  
  27. /* e_indent indexes */
  28. #define EI_NIDENT  16
  29. #define EI_MAG0    0
  30. #define EI_MAG1    1
  31. #define EI_MAG2    2
  32. #define EI_MAG3    3
  33. #define EI_CLASS   4
  34. #define EI_DATA    5
  35. #define EI_VERSION 6
  36. #define EI_PAD     7
  37.  
  38. /* EI_CLASS */
  39. #define ELFCLASSNONE 0
  40. #define ELFCLASS32   1
  41. #define ELFCLASS64   2
  42.  
  43. /* EI_DATA */
  44. #define ELFDATANONE 0
  45. #define ELFDATA2LSB 1
  46. #define ELFDATA2MSB 2
  47.  
  48. /* e_type */
  49. #define ET_NONE   0                 /* No file type */
  50. #define ET_REL    1                 /* Relocatable file */
  51. #define ET_EXEC   2                 /* Executable file */
  52. #define ET_DYN    3                 /* Shared object file */
  53. #define ET_CORE   4                 /* Core file */
  54. #define ET_LOPROC 0xFF00            /* Processor-specific */
  55. #define ET_HIPROC 0xFFFF            /* Processor-specific */
  56.  
  57. /* e_version */
  58. #define EV_NONE    0
  59. #define EV_CURRENT 1
  60.  
  61. /* e_machine */
  62. #define EM_NONE           0
  63. #define EM_M32            1
  64. #define EM_SPARC          2
  65. #define EM_386            3
  66. #define EM_68K            4
  67. #define EM_88K            5
  68. #define EM_860            7
  69. #define EM_MIPS           8
  70. #define EM_MIPS_RS4_BE    10
  71. #define EM_SPARC64        11
  72. #define EM_PARISC         15
  73. #define EM_PPC_OLD        17
  74. #define EM_SPARC32PLUS    18
  75. #define EM_PPC            20
  76. #define EM_CYGNUS_POWERPC 0x9025
  77. #define EM_ALPHA          0x9026
  78.  
  79. /* values for program header, p_type field */
  80. #define PT_NULL    0                /* Program header table entry unused */
  81. #define PT_LOAD    1                /* Loadable program segment */
  82. #define PT_DYNAMIC 2                /* Dynamic linking information */
  83. #define PT_INTERP  3                /* Program interpreter */
  84. #define PT_NOTE    4                /* Auxiliary information */
  85. #define PT_SHLIB   5                /* Reserved, unspecified semantics */
  86. #define PT_PHDR    6                /* Entry for header table itself */
  87. #define PT_LOPROC  0x70000000       /* Processor-specific */
  88. #define PT_HIPROC  0x7FFFFFFF       /* Processor-specific */
  89.  
  90. /* Program segment permissions, in program header p_flags field */
  91. #define PF_X        (1 << 0)        /* Segment is executable */
  92. #define PF_W        (1 << 1)        /* Segment is writable */
  93. #define PF_R        (1 << 2)        /* Segment is readable */
  94. #define PF_MASKPROC 0xF0000000      /* Processor-specific reserved bits */
  95.  
  96. /* special sections indexes */
  97. #define SHN_UNDEF 0
  98. #define SHN_ABS 0xfff1
  99. #define SHN_COMMON 0xfff2
  100.  
  101. /* sh_type */
  102. #define SHT_NULL        0           /* Section header table entry unused */
  103. #define SHT_PROGBITS    1           /* Program specific (private) data */
  104. #define SHT_SYMTAB      2           /* Link editing symbol table */
  105. #define SHT_STRTAB      3           /* A string table */
  106. #define SHT_RELA        4           /* Relocation entries with addends */
  107. #define SHT_HASH        5           /* A symbol hash table */
  108. #define SHT_DYNAMIC     6           /* Information for dynamic linking */
  109. #define SHT_NOTE        7           /* Information that marks file */
  110. #define SHT_NOBITS      8           /* Section occupies no space in file */
  111. #define SHT_REL         9           /* Relocation entries, no addends */
  112. #define SHT_SHLIB       10          /* Reserved, unspecified semantics */
  113. #define SHT_DYNSYM      11          /* Dynamic linking symbol table */
  114. #define SHT_LOPROC      0x70000000  /* Processor-specific semantics, lo */
  115. #define SHT_HIPROC      0x7FFFFFFF  /* Processor-specific semantics, hi */
  116. #define SHT_LOUSER      0x80000000  /* Application-specific semantics */
  117. #define SHT_HIUSER      0x8FFFFFFF  /* Application-specific semantics */
  118.  
  119. /* sh_flags */
  120. #define SHF_WRITE     (1 << 0)      /* Writable data during execution */
  121. #define SHF_ALLOC     (1 << 1)      /* Occupies memory during execution */
  122. #define SHF_EXECINSTR (1 << 2)      /* Executable machine instructions */
  123. #define SHF_MASKPROC  0xF0000000    /* Processor-specific semantics */
  124.  
  125. /* Values of note segment descriptor types for core files. */
  126. #define NT_PRSTATUS 1               /* Contains copy of prstatus struct */
  127. #define NT_FPREGSET 2               /* Contains copy of fpregset struct */
  128. #define NT_PRPSINFO 3               /* Contains copy of prpsinfo struct */
  129.  
  130. #define STN_UNDEF 0                 /* undefined symbol index */
  131.  
  132. /* ST_BIND */
  133. #define STB_LOCAL  0                /* Symbol not visible outside obj */
  134. #define STB_GLOBAL 1                /* Symbol visible outside obj */
  135. #define STB_WEAK   2                /* Like globals, lower precedence */
  136. #define STB_LOPROC 13               /* Application-specific semantics */
  137. #define STB_HIPROC 15               /* Application-specific semantics */
  138.  
  139. /* ST_TYPE */
  140. #define STT_NOTYPE  0               /* Symbol type is unspecified */
  141. #define STT_OBJECT  1               /* Symbol is a data object */
  142. #define STT_FUNC    2               /* Symbol is a code object */
  143. #define STT_SECTION 3               /* Symbol associated with a section */
  144. #define STT_FILE    4               /* Symbol gives a file name */
  145. #define STT_LOPROC  13              /* Application-specific semantics */
  146. #define STT_HIPROC  15              /* Application-specific semantics */
  147.  
  148. /* Dynamic section tags */
  149. #define DT_NULL     0
  150. #define DT_NEEDED   1
  151. #define DT_PLTRELSZ 2
  152. #define DT_PLTGOT   3
  153. #define DT_HASH     4
  154. #define DT_STRTAB   5
  155. #define DT_SYMTAB   6
  156. #define DT_RELA     7
  157. #define DT_RELASZ   8
  158. #define DT_RELAENT  9
  159. #define DT_STRSZ    10
  160. #define DT_SYMENT   11
  161. #define DT_INIT     12
  162. #define DT_FINI     13
  163. #define DT_SONAME   14
  164. #define DT_RPATH    15
  165. #define DT_SYMBOLIC 16
  166. #define DT_REL      17
  167. #define DT_RELSZ    18
  168. #define DT_RELENT   19
  169. #define DT_PLTREL   20
  170. #define DT_DEBUG    21
  171. #define DT_TEXTREL  22
  172. #define DT_JMPREL   23
  173. #define DT_LOPROC   0x70000000
  174. #define DT_HIPROC   0x7fffffff
  175.  
  176.  
  177. #endif
  178.